package com.easy.service.impl;

import com.easy.bean.Category;
import com.easy.dao.CategoryDao;
import com.easy.service.ICategoryService;
import com.easy.util.Page;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Collections;
import java.util.List;

@Service
public class CategoryService implements ICategoryService {
    @Autowired
    CategoryDao categoryDao;

    @Override
    public int add(Category category) {
        return categoryDao.add(category);
    }

    @Override
    public int delete(int cateid) {
        return categoryDao.delete(cateid);
    }

    @Override
    public int edit(Category category) {
        return categoryDao.edit(category);
    }

    @Override
    public Category getById(int cateid) {
        return categoryDao.getById(cateid);
    }

    @Override
    public List<Category> getList(Page page, String text) {
        return categoryDao.getList(page,text);
    }

    @Override
    public List<Category> getChildren(int parentid) {
        return categoryDao.getChildren(parentid);
    }

    @Override
    public int getCount(String text) {
        return categoryDao.getCount(text);
    }
}
